@import "../style/theme-color";

.d-input {
  width: 100%;
  height: 48px;
  margin: 24px 0;
  line-height: 1;
  position: relative;
  border: solid @gray;
  border-width: 0 0 1px 1px;
  box-sizing: border-box;

  .check-failed-text {
    position: absolute;
    bottom: -20px;
    left: 9px;
    font-size: 12px;
    color: #D43739;
    font-weight: bold;
  }

  .fade-enter-active, .fade-leave-active {
    transition: .5s cubic-bezier(.215, .61, .355, 1);
  }

  .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
    color: @gray;
    transform: translate3d(0, -4px, 0);
    opacity: 0;
  }

  &.active {
    border-color: @orange;

    &.filled {
      border-color: @gray;
    }

    .d-input-placeholder {
      padding: 0;
      top: 7px;
      left: 12px;
      line-height: 16px;
      font-size: 12px;
      color: @orange;
      cursor: default;
      font-weight: bold;
    }
  }

  &.check-failed {
    border-color: #CF2323 !important;
  }

  .d-input-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    padding: 16px 12px 7px;
    font-size: 24px;
    color: @gray;
    cursor: text;
    transition: .3s;
  }

  > input {
    position: absolute;
    left: 0;
    bottom: 3px;
    z-index: 2;
    width: 100%;
    padding: 0 48px 0 12px;
    height: 24px;
    border: none;
    box-sizing: border-box;
    font-size: 18px;
    color: #383838;
    background: transparent;
    outline: none;
    caret-color: #f08519;

    &:disabled {
      opacity: .5;
      cursor: not-allowed;
    }
  }

  .check-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    position: absolute;
    top: 0;
    right: 0;

    > img {
      width: 32px;
    }
  }
}
